import storage from 'good-storage'

const TOKEN = '__token__'

const PUBLIC_KEY = '__key__'

export function saveToken (token) {
  storage.session.set(TOKEN, token)
}

export function saveKey (key) {
  storage.session.set(PUBLIC_KEY, key)
}

export function loadToken () {
  return storage.session.get(TOKEN)
}

export function loadKey () {
  return storage.session.get(PUBLIC_KEY)
}

export function clear () {
  storage.session.remove(TOKEN)
}
